
#tram
library(sqldf)
data=read.csv("C:/myd.csv")
data2 = sqldf("select station,count(pm25) as MOD from data group by station;")
write.csv(data2,"C:/tram_thang_mod.csv")

#nam
library(sqldf)
data=read.csv("C:/mod.csv")
data2 = sqldf("select year,month,count(pm25) as MOD from data group by year,month;")
write.csv(data2,"C:/tram_thang_mod.csv")


library(sqldf)
data=read.csv("C:/myd04.csv")
data2 = sqldf("select tram,count(nam) from data group by tram;")
write.csv(data2,"C:/trammyd04.csv")

library(sqldf)
data=read.csv("C:/myd04.csv")
data2 = sqldf("select thang,count(nam) from data group by thang;")
write.csv(data2,"C:/thangmyd04.csv")

library(sqldf)
data=read.csv("C:/myd.csv")
data2 = sqldf("select station,count(pm25) from data group by station;")
write.csv(data2,"C:/trammyd.csv")

library(sqldf)
data=read.csv("C:/mod.csv")
data2 = sqldf("select station,count(pm25) from data group by station;")
write.csv(data2,"C:/trammod.csv")

library(sqldf)
data=read.csv("C:/mod04.csv")
data2 = sqldf("select thang,count(nam) from data group by thang;")
write.csv(data2,"C:/thangmod04.csv")
